//index.js
//获取应用实例
var app = getApp();
var Utils = app.CommonUtils;
var Keys = require('../../assets/data/keys.js');
const Toptips = require('../../dist/toptips/index');

Page(Object.assign({}, Toptips, {
	data: {
		statusType: ["积分明细", "积分提现"],
		tabTypeIndex: 0,//导航栏标识
		pId: 0,
		isCollect: 0, //0:未收藏  1：收藏
		autoplay: true,
		interval: 3000,
		duration: 1000,
		goodsDetail: {},
		swiperCurrent: 0,
		hasMoreSelect: false,
		selectSize: "选择：",
		selectSizePrice: 0,
		shopNum: 0,
		hideShopPopup: true,
		buyNumber: 0,
		buyNumMin: 1,
		buyNumMax: 0,

		propertyChildIds: "",
		propertyChildNames: "",
		canSubmit: false, //  选中规格尺寸时候是否允许加入购物车
		shopCarInfo: {},
		shopType: "addShopCar",//购物类型，加入购物车或立即购买，默认为加入购物车

		currentType: 0,
		datas: '',
		show1: false,
		show2: true,
		I_IsAdd: ""
	},

	onLoad: function (e) {
		var _this = this;
    var _Token;
    try {
      var value = wx.getStorageSync('Token')
      if (value) {
        // Do something with return value
        _Token = value;
      }
    } catch (e) {
      // Do something when catch error
    }

		wx.showLoading({
			title: '数据加载中',
		})
		wx.request({
      url: "https://www.chnode.xyz/api/My.ashx?",
			data: {
				DataType: "MyIntegralList",
				Token: _Token,
			},
			success: function (res) {
				console.log(res.data);
				if (res.data.isok == "false")
					_this.showZanTopTips(res.data.info);
				else {
					_this.setData({
						datas: res.data.datas
					})
				}
			},
			complete: function (e) {
				wx.hideLoading();
			}
		})
	},

	btnEventTab1: function () {
		this.setData({ tabTypeIndex: 0 })
	},
	btnEventTab2: function () {
		this.setData({ tabTypeIndex: 1 })
	},
}))
